import React from "react";
import { Navigate } from "react-router-dom";
import Home from "../pages/Home";
import Products from "../pages/Products";
import Categories from "../pages/Categories";
import Orders from "../pages/Orders";
import Users from "../pages/Users";
import Roles from "../pages/Roles";
import Login from "../pages/Login";
import ProtectedRoute from "../components/ProtectedRoute";

export const routes = [
    {
        path: "/login",
        element: <Login />,
    },
    {
        path: "/home",
        element: (
            <ProtectedRoute>
                <Home />
            </ProtectedRoute>
        ),
    },
    {
        path: "/products",
        element: (
            <ProtectedRoute>
                <Products />
            </ProtectedRoute>
        ),
    },
    {
        path: "/categories",
        element: (
            <ProtectedRoute>
                <Categories />
            </ProtectedRoute>
        ),
    },
    {
        path: "/orders",
        element: (
            <ProtectedRoute>
                <Orders />
            </ProtectedRoute>
        ),
    },
    {
        path: "/users",
        element: (
            <ProtectedRoute>
                <Users />
            </ProtectedRoute>
        ),
    },
    {
        path: "/roles",
        element: (
            <ProtectedRoute>
                <Roles />
            </ProtectedRoute>
        ),
    },
    {
        path: "/",
        element: <Navigate to="/home" replace />,
    },
];
